#!perl

print
  map       {#+@^=~[%%{*(;$
    $   _   ."\t= ".#%;:}])
  join      ('_',#~!]=]%~&,
    &   _   (#]@+~+#+%}%@#:
    $   _   )).";".$/}#$}}:
  map       {(##*?;<})):%?=
    $   _   ,#@}&$?;;(*}}}}
    @   _   )=/[^=;\s_]+/g;
    $   _   {#;!,&<%@]!{})[
    $   _   }=[#&#*!?=,(]?!
    @   _   ];#+?[(?+<{=}=&
    $   _   }<DATA>;#{&+~@?
  sub   _   {#{)<({?@$=<~$>
  map
    $   _   {#{;,~:*}]!=={%
    $   _   }#]%;<+)=}~!!&?
    ?   _   (@{#;=()@$+;&~+
    $   _   {#+&>$=^#*&$)#>
    $   _   }}):#:#!%})^#)}
    $   _   ,#{>[*?+!*%~:},
    @   _   }##{)*)~^#%>@!@

__DATA__
ABC     =   A1_B1;
ABD     =   C1_D1;
A1      =   D0_A0;
B1      =   A1_ABD;
C1      =   C0_ABD;
D1      =   B0_C1;
